//
//  PKBaseViewController.m
//  PianKe
//
//  Created by lanou on 15/9/25.
//  Copyright (c) 2015年 李伟伟. All rights reserved.
//

#import "PKBaseViewController.h"

@interface PKBaseViewController ()
@property(nonatomic, strong)UIButton *leftButton;
@end

@implementation PKBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.topView];
}

-(UIView *)topView
{
    if (!_topView) {
        _topView = [[UIView alloc]initWithFrame:CGRectMake(0, 20, SCREEN_HEIGHT, 50)];
        _topView.backgroundColor = [UIColor grayColor];
        _leftButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [_leftButton setTitle:@"三" forState:UIControlStateNormal];
        [_leftButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _leftButton.frame = CGRectMake(5, 10, 30, 30);
        [_leftButton addTarget:self action:@selector(changeViewFrame) forControlEvents:UIControlEventTouchUpInside];
        [_topView addSubview:_leftButton];
        [_topView addSubview:self.titleLabel];
//        [self.view addSubview:_topView];
    }
    return _topView;
    
    
}

-(void)changeViewFrame
{
    //切换试图的位置
    [self.changeFrameVC changeFrame];
      
}


-(UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, 10, 200, 30)];
    }
    return _titleLabel;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
